<template>
  <div>
    <div @click="fn">
      <p @click.stop="onefn"> 阻止事件冒泡</p>
      <a href="http://www.baidu.com" @click.prevent.stop>去百度</a>
      <p @click.once="twofn">点击观察事件函数执行几次</p>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    fn() {
      console.log('父级盒子  触发了事件');
    },
    onefn() {
      console.log('p标签点击了');
    },
    twofn() {
      console.log('执行了');
    }
  }
}
</script>

<style>

</style>